#ifndef	__SYS_SEARCH_H__
#define	__SYS_SEARCH_H__

#include <vector>

class Windows_Information_Collection;
class Windows_Information;

/*namespace windows_searcher
{
typedef int (*travel_callback)(const char *path);

int	travel_path_for_sub(const char *, const char **, int , travel_callback);
int	search_all_windows_in_main_path(const char * main_path);
int	search_windows_in_path(const char * intact_dir);
int	analyze_windows_information(Windows_Information * material);
Windows_Manager	&void get_information_of_windows();
}*/

class Windows_Searcher
{
public:
	typedef void (*travel_callback)(const char *path, void *data);
	Windows_Searcher(Windows_Information_Collection & win_info_group);
	virtual ~Windows_Searcher();
	static std::vector<std::string> enum_all_sub_directories_in_path(const char * path);
	int	search_all_windows_in_mounted_partition();
private:
	int	foreach_sub_directories_in_path(const char * path, travel_callback, 
	int except_num = 0, const char ** except = NULL, void *userdata = NULL) const;
	Windows_Information * analyze_win_root_for_windows_information(const char * win_root) const;
	static bool	get_windows_version_and_build_number(const char * win_root, 
	int & major_ver, int & minor_ver, int & build_num);
	static Windows_Edition get_windows_edition_from_version_and_build_number(
	int major_ver, int minor_ver, int build_num);
	static Windows_Edition get_windows_edition(const char * win_root);
	static void	deal_dir_whitch_may_be_was_windows_root(const char *path, void *data);
	static void	try_to_find_windows_in_directory(const char *path, void *data);
	
	Windows_Information_Collection & windows_info_group_;
};

#endif
